﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Administrator/Views/Shared/AdminMasterPage.master"
    Inherits="System.Web.Mvc.ViewPage<easyccms.WebUI.Areas.Administrator.Models.BinModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="page-title ui-widget-content ui-corner-all">
        <h1>
            Viewing: <b>Bin</b></h1>
        <div class="other">
            <div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
                <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                    <%
                        string activeTab = ViewData["SelectedTab"] != null ? ViewData["SelectedTab"].ToString() : string.Empty;
                        
                        int i = 1;
                        foreach (string controller in Model.BinCollection)
                        {
                            if (controller != "Bin" && controller != "Management" && controller != "Examples")
                            {
                                string tabName = controller + i++;
                                

                    
                    if (controller==activeTab)
                    {
                        Response.Write("<li class=\"ui-state-default ui-corner-top ui-tabs-selected ui-state-active \"><a href=\"#" + tabName + "\">" +
                                       controller + "</a></li>");
                    }else
                    {
                        Response.Write("<li class=\"ui-state-default ui-corner-top \"><a href=\"#" + tabName + "\">" +
                                       controller + "</a></li>");
                    }%>
                    <%
                            }
        }
                    %>
                </ul>
                <%
                    int j = 1;
                    foreach (string controller in Model.BinCollection)
                    {
                        if (controller != "Bin" && controller != "Management" && controller != "Examples")
                        {
                            string tabName = controller + j++;
                            try
                            {
                %>
                <%=
    "<div id=\"" + tabName + "\" class=\"ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide\">"
                %><%
                    Html.RenderAction("Bin", controller);
                }
                catch (Exception exception)
                {
                    Response.Write(string.Format(
                        "Controller {0} does not have action Bin Implemented.<br>{1} <br>", controller,
                        exception.Message));
                }
                %>
                <%="</div>"%>
                <%
            }
        }
                %>
            </div>
            <div class="clearfix">
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JavaScriptHolder" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
</asp:Content>
